#ifndef Vxl_OBJECT_H
#define Vxl_OBJECT_H

#include <d3d11.h>
#include <d3dx11.h>
#include <D3Dcompiler.h>
#include <xnamath.h>
#include "Drawable.h"
#include "..\Utils\CustomEffect.h"
#include "Blueprints\BaseBlueprint.h"

namespace Drawables{

	struct Vxl{
		XMFLOAT4 positionInObject;
		XMFLOAT4 color;
	};
	
	class VxlObject : public Drawable
	{
	public:
		VxlObject(void);
		~VxlObject(void);
		void AddVxl(XMFLOAT3 &pos, XMFLOAT4 &color);
		void VxlObject::CreateFromBlueprint(Blueprints::BaseBlueprint blueprint, XMFLOAT4 &color);

		void Initialize();
		void Draw();
		void Update(float dt);
		void SetVxlSize(float newVxlSize);

		static void SetPerFrame();

	private:
		static Utils::CustomEffect *effect;
		static bool VxlObjectEffectHasBeenSet;

		void ResizeArray(int newSize);
		void SetPerObjectShaderParameters();

		bool isInitialized;
		float VxlSize;
		std::vector<Vxl> Vxls;
		int VxlCount;
		int VxlArraySize;

	};

}


#endif

